package ocrsTest;


import junit.framework.TestCase;

import ocrs.Student;

import org.junit.After;
import org.junit.Before;

import com.google.appengine.api.datastore.*;

public class StudentTest extends TestCase {

	Student test;
	@Before
	public void setUp() throws Exception {
		test = new Student("John Doe","AB12345",new PostalAddress("12345 Address Street, State,Country,09876"),new Email("test@email.com"),"password","Visual Arts","Dance");
	}

	@After
	public void tearDown() throws Exception {
		test=null;
	}
	
	public void testStudent() {
		assertTrue(test.toString().equals(String.format("Name: %s\nCampusID: %s\nAddress: %s\nE-mail: %s\nMajor: %s\nMinor: %s",
											"John Doe",
											"AB12345",
											"12345 Address Street, State,Country,09876",
											"test@email.com",
											"Visual Arts",
											"Dance")));
	}
	
	public void testSetters() {
		test.declareMajor("Computer Engineering");
		test.declareMinor("Computer Science");
		assertTrue(test.toString().equals(String.format("Name: %s\nCampusID: %s\nAddress: %s\nE-mail: %s\nMajor: %s\nMinor: %s",
											"John Doe",
											"AB12345",
											"12345 Address Street, State,Country,09876",
											"test@email.com",
											"Computer Engineering",
											"Computer Science")));
	}

}
